package com.yanqu.road.entity.activity.hanghai;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.DataStatus;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@FieldTypeAnnotation(tableName = "t_u_activity_hanghai_union_data")
public class HangHaiUnionData extends DataObject {

    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;
    @FieldTypeAnnotation(desc = "商会UID", update = true)
    private String unionUid = "";
    @FieldTypeAnnotation(desc = "重置时间")
    private long lastResetTime;
//    @FieldTypeAnnotation(desc = "锁定名单")
//    private Map<Long, String> lockMemberMap = new ConcurrentHashMap<>();
//    @FieldTypeAnnotation(desc = "商会成员")
//    private Set<Long> memberList = new HashSet<>();

    private Map<Integer, HangHaiPort> portMap = new ConcurrentHashMap<>();

    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public void setUnionUid(String unionUid) {
        if (null == unionUid) {
            return;
        }
        if (!this.unionUid.equals(unionUid)) {
            this.unionUid = unionUid;
            setOp(DataStatus.Update);
        }
    }

    public void setLastResetTime(long lastResetTime) {
        if (this.lastResetTime != lastResetTime) {
            this.lastResetTime = lastResetTime;
            setOp(DataStatus.Update);
        }
    }

    public void setPortMap(Map<Integer, HangHaiPort> portMap) {
        this.portMap = portMap;
    }

    public int getActivityId() {
        return activityId;
    }

    public String getUnionUid() {
        return unionUid;
    }

    public long getLastResetTime() {
        return lastResetTime;
    }

    public Map<Integer, HangHaiPort> getPortMap() {
        return portMap;
    }

//    public Map<Long, String> getLockMemberMap() {
//        return lockMemberMap;
//    }
//
//    public void setLockMemberMap(Map<Long, String> lockMemberMap) {
//        if (lockMemberMap != null) {
//            this.lockMemberMap = lockMemberMap;
//            setUpdateOption();
//        }
//    }
//
//    public Set<Long> getMemberList() {
//        return memberList;
//    }
//
//    public void setMemberList(Set<Long> memberList) {
//        if (memberList != null) {
//            this.memberList = memberList;
//            setUpdateOption();
//        }
//    }
}
